/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __SKY_LIGHT_H__
#define __SKY_LIGHT_H__

#include "SceneObject.h"
#include "LightObject.h"

namespace PQEngine
{
    /*Simulate the sky light(sun moon).
	@remarks
	The sky light will follow the camera.
	*/
	class SkyLight
		: public Object
    {
	public:
		SkyLight(SceneObject* sceneObject);

		/** Updates skylight parameters.
		 *  @param direction Light direction.
		 *  @param lightColor Color for the light source.
		 *  @param bodyColor Color to draw the body of the light.
		 */
		virtual void update(const Ogre::Vector3& direction,const Ogre::ColourValue &lightColor,const Ogre::ColourValue &bodyColor);
		void setLightDirection(const Ogre::Vector3& direction);
		void setLightColor(const Ogre::ColourValue &color);
		void setBodyColor(const Ogre::ColourValue &color);

		virtual void setFarRadius(Ogre::Real radius);

	protected:
		SceneObject* _sceneObject;
		LightObject* _mainLight;

		Ogre::SceneNode* _sceneNode;

		
		Ogre::ColourValue _bodyColor;
		Ogre::ColourValue _lightColor;
		Ogre::ColourValue _diffuseMultiplier;
		Ogre::ColourValue _specularMultiplier;
		Ogre::ColourValue _ambientMultiplier;
		
		float _radius;/// Base distance of the light.
		Ogre::Vector3 _direction;/// The latest normalised sun direction.
    };
}

#endif
